package com.zzl.finance.data.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zzl.apidoc.annotation.ApidocModel;
import com.zzl.apidoc.annotation.ApidocModelProperty;
import com.zzl.finance.data.constant.status.InstitutyStatusEnum;
import com.zzl.finance.data.constant.type.FinancierTypeEnum;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 资金方，即金融机构
 *
 * @author gull
 * @date 2022-07-01 18:23:11
 */
@Data
@ApidocModel
@SuppressWarnings("javadoc")
public class FinanceInstitutyInfoDto implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApidocModelProperty(description = "主键")
    private String id;
    @ApidocModelProperty(description = "资金方名称，如XX银行")
    private String instinctyName;
    @ApidocModelProperty(description = "统一社会信用代码")
    private String socialCreditCode;
    @ApidocModelProperty(description = "企业电话")
    private String enterprisePhone;

    @ApidocModelProperty(description = "是否允许使用其他银行账户，0：不允许，1：允许")
    private Integer allowOtherAccount;
    @ApidocModelProperty(description = "上链地址")
    private String chainAddress;

    @ApidocModelProperty(description = "资金方类型，1：银行，2：保理商")
    private Integer financierType;
    @ApidocModelProperty(description = "接入方式，1 是（接口接入） 0 否（平台接入）")
    private Integer accessMode;
    @ApidocModelProperty(description = "资方状态，1 启用，0 冻结")
    private Integer institutyStatus;
    @ApidocModelProperty(description = "资金方类型，1：银行，2：保理商")
    private String financierTypeName;

    @ApidocModelProperty(description = "资方状态，1 启用，0 冻结")
    private String institutyStatusName;

    public String getFinancierTypeName() {
        if (null != financierType) {
            return FinancierTypeEnum.getValue(financierType);
        }
        return "";
    }


    public String getInstitutyStatusName() {
        if (null != institutyStatus) {
            return InstitutyStatusEnum.getValue(institutyStatus);
        }
        return "";
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApidocModelProperty(description = "创建时间", validate = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApidocModelProperty(description = "修改时间", validate = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    @ApidocModelProperty(description = "融资范围，选择支持债权所属金融机构范围，多选")
    private String financingScope;
    @ApidocModelProperty(description = "融资范围，选择支持债权所属金融机构范围，多选")
    private List<FinanceScopeInfoDto> scopeInfoDtoList;
    @ApidocModelProperty(description = "子产品配置")
    private List<FinancialProductInfoDto> productInfoDtoList;


}
